package com.yunxin.core.domain.service.order;

import com.yunxin.core.domain.model.order.OrderUserApply;
import com.yunxin.core.domain.model.order.OrderUserApplyAllocation;
import com.yunxin.core.domain.model.order.OrderUserApplyDetail;

import java.util.List;

/**
 * @author zero°
 * @since 2023-06-03
 */
public interface OrderService {

    /**
     * 保存用户申请订单
     * @param userApply userApply
     * @param orderUserApplyDetail orderUserApplyDetail
     */
    boolean saveOrderUserApply(OrderUserApply userApply, OrderUserApplyDetail orderUserApplyDetail);

    /**
     * 更新用户申请订单
     * @param userApply userApply
     * @param orderUserApplyDetail orderUserApplyDetail
     */
    void updateOrderUserApply(OrderUserApply userApply, OrderUserApplyDetail orderUserApplyDetail);


    /**
     * 保存用户申请分配订单
     * @param userApply userApply
     * @param orderUserApplyAllocation orderUserApplyAllocation
     * @param redisCashField redisCashField
     */
    void saveOrderUserApplyAllocation(OrderUserApply userApply, OrderUserApplyAllocation orderUserApplyAllocation,
                                      String redisCashField);

    /**
     * 根据手机号查询订单详情
     * @param phone
     * @return
     */
    OrderUserApply getIdByUserPhone(String phone);


    OrderUserApply selectOrderUserApplyAllocationByUserCode(String userCode,Long productId);

    List<OrderUserApply> selectOrderUserApplyAllocationByUserCode1(String userCode,Long productId);
}
